package com.learning.spring.boot.base;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 启动类
 *
 * @author Sam Sho
 */
@Slf4j
@SpringBootApplication
public class BaseApplication {

    public static void main(String[] args) {
//        baseRun(args);

        closeBanner(args);
    }


    /**
     * 基本启动
     *
     * @param args
     */
    public static void baseRun(String[] args) {
        SpringApplication.run(BaseApplication.class, args);
        log.info("~~ 1-springboot-base 启动成功 ~~");
    }

    /**
     * 关闭 Banner
     *
     * @param args
     */
    public static void closeBanner(String[] args) {

        SpringApplication application = new SpringApplication(BaseApplication.class);
        application.setBannerMode(Banner.Mode.OFF);
        application.run(args);
        log.info("~~ 1-springboot-base 启动成功 ~~");
    }
}
